package ObjectStatic.ObjectStaticExercise001;

/**
 * ClassName:StudentText
 * Package:ObjectStatic.a01StaticDemo001
 * Description:
 *
 * @Author:ZhangXin
 * @Create2023/1/19-11:05
 * @Version:v1.0
 */
public class StudentText {
    public static void main(String[] args) {
        //用static修饰后多一种调用方式
        //类名调用
        Student.teacherName="阿伟老师";
        //创建第一个对象
        Student s1=new Student();
        s1.setName("张三");
        s1.setAge(23);
        s1.setGender("男");
        //对象名调用
//        s1.teacherName="阿伟老师";
        s1.study();
        s1.show();

        //创建第二个对象
        Student s2=new Student();
        s2.setName("李四");
        s2.setAge(23);
        s2.setGender("女");
        s2.study();
        s2.show();
    }
}
